﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="tm_profileList.ascx.cs" Inherits="controls_tm_profileList" %>

    <asp:Panel ID="palSearch" runat="server" Width="100%" Visible="false">
        <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
            <tr>
                <td>
                    <asp:Label ID="Label5" runat="server" CssClass="titletext3" Text="Mô tà :"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtDescription" runat="server" Width="300px"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label6" runat="server" CssClass="titletext3" Text="Ngày đăng tạo :"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtRisgrterFromDate" runat="server" Width="100px"></asp:TextBox>
                    <asp:HyperLink ID="hplRegisterFromDate" runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink>&nbsp;
                    <asp:TextBox ID="txtRisgrterToDate" runat="server" Width="100px"></asp:TextBox><asp:HyperLink ID="hplRegisterToDate"
                        runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label7" runat="server" CssClass="titletext3" Text="Ngày hết hạn :"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtExpireFromDate" runat="server" Width="100px"></asp:TextBox>
                    <asp:HyperLink ID="hplExprieFormDate" runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink>&nbsp;
                    <asp:TextBox ID="txtExpireToDate" runat="server" Width="100px"></asp:TextBox><asp:HyperLink ID="hplExprieToDate"
                        runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label8" runat="server" CssClass="titletext3" Text="Trạng thái :"></asp:Label></td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="156px">
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" CssClass="btn" Text="Tìm" Width="80px" OnClick="btnSearch_Click" />
                    <asp:Button ID="bntRefresh" runat="server" CssClass="btn" Text="Làm lại" Width="80px" /></td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label ID="lblTotal" runat="server" CssClass="titletext3"></asp:Label></td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="pnlItemList" runat="server" Width="100%">
        <table width="100%">
            <tr>
                <td align="center" style="height: 21px">
                    <asp:Label ID="lblMessage" runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvItemList" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" DataKeyNames="userId" OnPageIndexChanging="gvItemList_PageIndexChanging" Width="100%" OnSorting="gvItemList_Sorting" CssClass="table">
                        <Columns>
                            <asp:TemplateField>
                                <ItemStyle HorizontalAlign="Center" Width="2%" />
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkItem" runat="server" />
                                    <asp:Label ID="lblRowId" runat="server" Text='<%# Eval("rowId") %>' Visible="False"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="M&#244; tả" SortExpression="description">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="hlpDescription" runat="server" NavigateUrl='<%# GetURL(DataBinder.Eval(Container, "DataItem.infoId").ToString()) %>' Text='<%# DataBinder.Eval(Container, "DataItem.description") %>'></asp:HyperLink>                                                
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ng&#224;y tạo" SortExpression="createDate">
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# ((DateTime)DataBinder.Eval(Container, "DataItem.createDate")).ToShortDateString() %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ng&#224;y đăng" SortExpression="ondate">
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:Label ID="lblOnDate" runat="server" Text='<%# DateString(DataBinder.Eval(Container, "DataItem.onDate").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ng&#224;y hết hạn" SortExpression="expireDate">
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# DateString(DataBinder.Eval(Container, "DataItem.expireDate").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Li&#234;n.hệ">
                                <ItemStyle HorizontalAlign="Center" Width="8%" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="hplContact" runat="server" ImageUrl="~/images/icon_bulkmail_16px.gif" NavigateUrl='<%# GetContactLink(DataBinder.Eval(Container, "DataItem.receiverid").ToString(),DataBinder.Eval(Container, "DataItem.infoId").ToString()) %>'>HyperLink</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Trạng th&#225;i" SortExpression="status">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("status") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("status") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField SortExpression="status">
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemTemplate>
                                    <asp:Label ID="lblStatus" runat="server" Text='<%# ExpiredStatus(DataBinder.Eval(Container, "DataItem.onDate").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemStyle Width="2%" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="hplEdit" runat="server" ImageUrl="~/images/myEdit.gif" NavigateUrl='<%# GetEditURL(DataBinder.Eval(Container, "DataItem.infoId").ToString()) %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle HorizontalAlign="Right" />
                        <PagerSettings Mode="NumericFirstLast" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td width="100%">
                    <asp:Panel ID="pnlBottom" runat="server" Width="100%">
                        <table width="100%">
                            <tr>
                                <td style="width: 50%">
                                    <asp:CheckBox ID="chkCheckAll" runat="server" AutoPostBack="True" OnCheckedChanged="chkCheckAll_CheckedChanged" CssClass="titletext3" Text="Chọn tất cả" /></td>
                                <td align="right">
                                    <asp:Button ID="btnProcessSelected" runat="server" Font-Bold="True"
                                        OnClick="btnProcessSelected_Click" Text="Xóa chọn" CssClass="btn" OnClientClick="return confirm('Bạn muốn xóa khỏi hệ thống ?');" />
                                    </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table>
        <asp:Label ID="lblDebugMessage" runat="server" CssClass="titletext3"></asp:Label></asp:Panel>

